package com.tedu.bill.demo2;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.UUID;

/**
 * Author：毕龙
 * Date: 2024/5/26 15:53
 */
public class TestFileCopy2 {
    public static void main(String[] args) throws IOException {
        //创建输入流
        FileInputStream fis = new FileInputStream("day14/src/com/tedu/bill/demo2/54029eb237559dfa17fb9af93bd00806.jpg");

        //创建输出流
        FileOutputStream fos = new FileOutputStream("day14/src/com/tedu/bill/demo1/"+ UUID.randomUUID().toString().replace("-", "")+".jpg");
        int read;
        while ((read=fis.read())!= -1){
            fos.write(read);
        }
        //释放流
        fos.close();
        fis.close();
    }
}
